package io.renren.modules.sys.web_api.controller;

import io.renren.common.utils.R;

import io.renren.modules.sys.web_api.service.FirstPageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;


import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("api")
public class WebApiController {
    @Autowired
    private FirstPageService firstPageService;
    @RequestMapping("/first")
    public String CrawlerFirst( Map<String,Object> backdata){
        List<Map<String,Object>> lunbo = firstPageService.firstPageLunBo();
        backdata.put("lunbo",lunbo);
        //推荐产品
        List<Map<String,Object>> tuijian = firstPageService.firstPageTuiJian();
        backdata.put("tuijian",tuijian);
        //首页产品分类
        //推荐产品
        List<Map<String,Object>> fenlei = firstPageService.firstPageProFenLei();
        backdata.put("fenlei",fenlei);
        //首页技术
        List<Map<String,Object>> jiShu = firstPageService.firstPageJiShu();
        backdata.put("jiShu",jiShu);
        //首页wenda
        List<Map<String,Object>> wenda = firstPageService.firstPageWenDa();
        backdata.put("wenda",wenda);
        //首页renwu
        List<Map<String,Object>> renwu = firstPageService.firstPageRenWu();
        backdata.put("renwu",renwu);
        //首页pinpai
        List<Map<String,Object>> pinpai = firstPageService.firstPagePinpai();
        backdata.put("pinpai",pinpai);
        //首页中条目
        int su = firstPageService.getzhongtiaomu();
        backdata.put("tiaoshu",su);
        //首页中条目
        int re = firstPageService.getrenwumu();
        backdata.put("renshu",re);
        return "webpage/index";
    }
}
